(perform-replace): Use query-replace-map.
(query-replace, query-replace-regexp, map-query-replace-regexp):
(replace-string, replace-regexp): Don't print `done' if unread chars.
(replace-match next-replacement nocasify literal)
(setq replace-count (1+ replace-count)))
(undo-boundary)
- (let (done replaced key)
+ (let (done replaced key def)
;; Loop reading commands until one of them sets done,
;; which means it has finished handling this occurrence.
(while (not done)